package com.cms.common.model.services.impl;


import com.cms.common.model.entity.ActionLog;
import com.cms.common.model.entity.AdminUser;
import com.cms.common.model.repository.ActionLogRepository;
import com.cms.common.model.services.ActionLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service("ActionLogService")
public class ActionLogServiceImpl implements ActionLogService {

    @Autowired
    ActionLogRepository actionLogRepository;


    public void logTypeAdd(AdminUser adminUser,String action, String type, Long typeId, String note) {
        ActionLog actionLog = new ActionLog();
        actionLog.setAdminUser(adminUser);
        actionLog.setType(type);
        actionLog.setTypeId(typeId);
        actionLog.setAction(action);
        actionLog.setNote(note);
        actionLogRepository.saveAndFlush(actionLog);
    }

}
